﻿using System.Collections.Generic;
namespace MessageMachine
{
    public struct Message
    {
        public int msgType;
        public object extraInfo;
        public ISubscriber sender;
        public List<ISubscriber> receivers;

        public Message(int msgType)
        {
            this.msgType = msgType;
            extraInfo = sender = null;
            receivers = null;
        }

        public Message(int msgType, object extraInfo, ISubscriber sender)
        {
            this.msgType = msgType; this.extraInfo = extraInfo; this.sender = sender;
            receivers = null;
        }

        public Message(int msgType, object extraInfo, ISubscriber sender, List<ISubscriber> receivers)
        {
            this.msgType = msgType; this.extraInfo = extraInfo; this.sender = sender; this.receivers = receivers;
        }

        public Message(int msgType, object extraInfo, ISubscriber sender, ISubscriber receiver)
        {
            this.msgType = msgType; this.extraInfo = extraInfo; this.sender = sender; this.receivers = new List<ISubscriber>(1) { receiver };
        }
    }
}
